﻿module HttpInterfaces

open System.IO
open Uris



type Body = 
    | TextBody of string
    | BinaryBody of string*MemoryStream

type IHttpResponse =
    abstract statusCode : int
    abstract headers : Map<string,string>
    abstract body : Body

type ResponseOption = Success of IHttpResponse*HttpUrl | Failure of string

type HttpRequest = 
    | GetRequest of HttpUrl 
    | PostRequest of HttpUrl * string
    with
    member this.url =
        match this with
        | GetRequest(url) -> url
        | PostRequest(url, payload) -> url


